package com.joysuch.wwyt.bp.entity.contractor;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.time.LocalDate;
import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * 承包商施工管理
 *
 * @author sumeiqi
 * 2021-01-12
 */
@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Entity
@Table(name = "wwyt_bp_contractor_construction_management")
@SQLDelete(sql = "update wwyt_bp_contractor_construction_management set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update wwyt_bp_contractor_construction_management set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")
@Data
@TableName("wwyt_bp_contractor_construction_management")
public class BpContractorConstructionRecord {

    @Id
    @GeneratedValue(strategy = IDENTITY)
    private Long id;
    @ApiModelProperty("承包商施工管理编码")
    private String code;
    @ApiModelProperty("承包商表Id")
    private Long contractorId;
    @ApiModelProperty("特种设备安装许可证")
    private String specialEquipmentErectionPermit;
    @ApiModelProperty("营业执照字号")
    private String businessLicenseNo;
    @ApiModelProperty("施工队伍营业等级")
    private String constructionTeamLevel;
    @ApiModelProperty("施工队伍负责人")
    private String constructionTeamDirector;
    @ApiModelProperty("施工队负责人联系电话")
    private String constructionTeamDirectorPhone;
    @ApiModelProperty("施工队伍负责人身份证")
    private String constructionTeamDirectorIdCard;
    @ApiModelProperty("安全负责人")
    private String safetyDirector;
    @ApiModelProperty("安全负责人联系电话")
    private String safetyDirectorPhone;
    @ApiModelProperty("安全负责人身份证")
    private String safetyDirectorIdCard;
    @ApiModelProperty("进厂日期")
    private LocalDate intoFactoryDate;
    @ApiModelProperty("考核日期")
    private LocalDate inspectionDate;
    @ApiModelProperty("是否在黑名单 0 否; 1 是")
    private String isBlacklist;

    @ApiModelProperty("项目名称")
    private String projectName;
    @ApiModelProperty("施工日期")
    private LocalDate doWorkDate;
    @ApiModelProperty("完工验收日期")
    private LocalDate checkWorkDate;
    @ApiModelProperty("完工评价")
    private String overOpinion;



    //通用字段
    @ApiModelProperty("数据状态字段: 0 无效; 1 有效")
    private Integer state;
    @ApiModelProperty("创建人")
    @org.springframework.data.annotation.CreatedBy
    @JsonIgnore
    private Long createBy;
    @ApiModelProperty("创建时间")
    @org.springframework.data.annotation.CreatedDate
    @JsonIgnore
    private java.time.LocalDateTime createTime;
    @ApiModelProperty("更新人")
    @org.springframework.data.annotation.LastModifiedBy
    @JsonIgnore
    private Long updateBy;
    @ApiModelProperty("更新时间")
    @org.springframework.data.annotation.LastModifiedDate
    @JsonIgnore
    private java.time.LocalDateTime updateTime;
    @ApiModelProperty("租户")
    @JsonIgnore
    private Long tenentId;
    @ApiModelProperty("组织机构代码")
    @JsonIgnore
    private String orgCode;
    @ApiModelProperty("删除标记")
    @JsonIgnore
    private String deleteFlag;
}
